package com.iris.live.services.data.repositories;

import com.iris.live.services.data.models.TDccDistributionLogModel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by lusong on 2017/8/9.
 */
public interface TDccDistributionLogRepository extends JpaRepository<TDccDistributionLogModel, Integer>, JpaSpecificationExecutor<TDccDistributionLogModel> {

    @Query("select a from TDccDistributionLogModel a where a.importId = ?1")
    List<TDccDistributionLogModel> getModelByImportId(int importId);

    @Query("select a from TDccDistributionLogModel a where a.overdueTime < current_time")
    List<TDccDistributionLogModel> getOverTimeInfo();
}
